<?php
//by willson 105328468@qq.com 2014/10/11
//index page interface

class country extends core {

	public function __construct() {
		parent::__construct();
	}

	public function index() {
		$offset = (isset($_GET['offset']) && trim($_GET['offset'])) ? intval($_GET['offset']) : 0;
		$pagesize = (isset($_GET['pagesize']) && trim($_GET['pagesize'])) ? intval($_GET['pagesize']) : 6;
		$sql = "SELECT * FROM {$this->tbp}country WHERE status='1' ORDER BY sort ASC, id DESC
			LIMIT {$offset}, {$pagesize}";
		$rs = $this->db->get_results($sql);
		if ($rs) {
			$rs = add_domain_deep($rs, array("detail_pic", "list_pic_big", "list_pic_small", "flag_pic"));
		}
		success($rs);
	}
}
